package com.baicizhan;

import org.junit.Test;

import java.util.Scanner;

public class test1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String s = sc.nextLine();
            System.out.println(getString(s));
        }
    }


    public static String getString(String s){
        StringBuilder strb = new StringBuilder();
        char[] str = s.toCharArray();
        int len = s.length();
        int cnt = 0;
        for(int i = 0; i<len; i++){
            cnt++;
            if(i == len - 1 || str[i] != str[i+1]){
                strb.append(str[i] + "" + cnt);
                cnt = 0;
            }
        }
        return strb.toString();
    }

    @Test
    public void test(){
        System.out.println(getString("aabccccaaa"));
    }
}
